﻿using DLLPC.Utilities;
using PCBase.UIControls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VisionCore
{
    public class PRM_PanelInfo
    {
        [DisplayName("01.冶具参数"), Description("冶具参数"), ReadOnly(true)]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public PRM_FixtureInfo Info { get; set; } = new PRM_FixtureInfo();

        [DisplayName("02.未加工NG冶具参数"), Description("未加工NG冶具参数"), ReadOnly(true)]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public PRM_FixtureInfo NGInfo { get; set; } = new PRM_FixtureInfo();

        [DisplayName("03.已加工NG冶具参数"), Description("已加工NG冶具参数"), ReadOnly(true)]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public PRM_FixtureInfo AlreadyLaserNGInfo { get; set; } = new PRM_FixtureInfo();

        [DisplayName("11.Mark1"), Description("Mark1位置"), ReadOnly(true)]
        public Panel_Point Mark1 { get; set; } = new Panel_Point();

        [DisplayName("12.Mark2"), Description("Mark2位置"), ReadOnly(true)]
        public Panel_Point Mark2 { get; set; } = new Panel_Point();

        public override string ToString()
        {
            return "...";
        }
    }

    public class Panel_Point
    {
        public double X { get; set; }
        public double Y { get; set; }

        public Panel_Point()
        {
            this.X = 0;
            this.Y = 0;
        }

        public override string ToString()
        {
            return "...";
        }
    }

    public class PRM_FixtureInfo
    {
        [DisplayName("01.RowSize 行数"), Description("行数")]
        public int RowSize { get; set; } = 5;

        [DisplayName("02.ColSize 列数"), Description("列数")]
        public int ColSize { get; set; } = 2;

        [DisplayName("03.RowHeight 行高"), Description("行高(单位mm)")]
        public double RowHeight { get; set; } = 5.0;

        [DisplayName("04.ColWidth 列宽"), Description("列宽(单位mm)")]
        public double ColWidth { get; set; } = 5.0;

        [DisplayName("05.RowSize乘ColSize"), Description("数量(单位个)")]
        public int Num
        {
            get { return RowSize* ColSize; }
        }

        [DisplayName("06.Mark1与Mark2间距"), Description("单位mm")]
        [TypeConverter(typeof(PropertiesExpandConverter))]
        public ST_Point MarkPitch { get; set; } = new ST_Point();


        [DisplayName("10.基准点"), Description("第一行第一列基准点")]
        public PointRotation.Point Base { get; set; } = new PointRotation.Point();

        public override string ToString()
        {
            return "...";
        }
        public class ST_Point
        {
            public double X { get; set; }
            public double Y { get; set; }
            public double R { get; set; }

            public ST_Point()
            {
                X = 0;
                Y = 0;
                R = 0;
            }

            public override string ToString()
            {
                return "...";
            }
        }
    }
}
